package edu.tju.car;
import java.sql.SQLException;
import java.util.List;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;
public class IbatisCarHistoryDao implements ICarHistoryDao{
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();

	public void deleteCarHistory(long id) throws SQLException {
		sqlMap.delete("deleteCarHistory", id);
	}
	@SuppressWarnings("unchecked")
	public List<CarHistory> getCarHistoryAnd(CarHistory carHistory) throws SQLException {
		 return sqlMap.queryForList("getCarHistoryAnd", carHistory);
	}
	public CarHistory getCarHistoryById(long id) throws SQLException {
		return (CarHistory) sqlMap.queryForObject("getCarHistoryById", id);
	}
	public List<CarHistory> getCarHistoryOr(CarHistory carHistory) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}
	public Long insertCarHistory(CarHistory carHistory) throws SQLException {
		return (Long)sqlMap.insert("insertCarHistory", carHistory);
	}
	public int updateCarHistory(CarHistory carHistory) throws SQLException {
		return sqlMap.update("updateCarHistory", carHistory);
	}
}
